package com.nancy.java_design.factory_method.demo1;

/**
 * 咖啡店
 */
public class CoffeeStore {

    private CoffeeFactory coffeeFactory;

    public void setCoffeeFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = null;
        coffee = coffeeFactory.makeCoffee();
        coffee.addMilk();
        coffee.addSugur();
        return coffee;
    }
}


